using System;
using NUnit.Framework;

namespace TestsParking
{
	[TestFixture()]
	public class TestsTicket
	{
		[Test()]
		public void TestConstructeur ()
		{
			DateTime now = DateTime.Now;
			Parking.Ticket t = new Parking.Ticket();
			Assert.AreEqual (now.Day, t.heure_arrivee.Day);
			Assert.AreEqual (now.Hour, t.heure_arrivee.Hour);
			Assert.AreEqual (now.Minute, t.heure_arrivee.Minute);
			System.Threading.Thread.Sleep(5);
			Assert.AreEqual ((DateTime.Now - now).Days, t.duree_stationnement.Days);
			Assert.AreEqual ((DateTime.Now - now).Hours, t.duree_stationnement.Hours);
			Assert.AreEqual ((DateTime.Now - now).Minutes, t.duree_stationnement.Minutes);
		}
	}
}
